package com.mg.persional.controller;

import com.mg.common.vo.ResponseResult;
import com.mg.common.vo.ResponseStatus;
import com.mg.persional.entity.TbMemberDetail;
import com.mg.persional.service.TbMemberDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/tmd")
public class TbMemberDetailController {
    @Autowired
    TbMemberDetailService tmds;

    //根据用户ID进行修改
    @PutMapping("/updateById")
    public ResponseResult<Integer> updateById(TbMemberDetail tbMemberDetail){
        ResponseResult<Integer> result = tmds.updateById(tbMemberDetail);
        if (result != null){
            ResponseResult.ok(result);
        }else {
            ResponseResult.error(ResponseStatus.FAIL);
        }
        return result;
    }
    //伪删除
    @PutMapping("/delTmd")
    public ResponseResult<Integer> delTmd(int id){
        return tmds.delTbMember(id);
    }
}
